const Net = require('../../common.js')
Page({
  data: {
    active: 1,
    list: [],
    NowPage: 1
  },
  onLoad: function (options) {
    var _this = this
    Net.data({
      active: options.type
    })
    _this.onPageInfo()
  },
  onTapClick(e) {
    Net.data({
      active: e.currentTarget.id
    })
  },
  onPageInfo() {
    Net.link('v1/orderBill', {
      now_page: Net.data('NowPage')
    }, function (res) {
      for (let i in res.data.data.list) {
        res.data.data.list[i].create_time = Net.formatTime(res.data.data.list[i].create_time, 'M-D h:m')
      }
      Net.data({
        list: res.data.data.list
      })
    }, 'GET')
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {}
})